using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class DC_ConditionsMap : EntityTypeConfiguration<DC_Conditions>
    {
        public DC_ConditionsMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Code)
                .HasMaxLength(15);

            this.Property(t => t.Note)
                .HasMaxLength(100);

            this.Property(t => t.Physician)
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("DC_Conditions");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.Note).HasColumnName("Note");
            this.Property(t => t.Toothnb).HasColumnName("Toothnb");
            this.Property(t => t.PatIID).HasColumnName("PatIID");
            this.Property(t => t.Physician).HasColumnName("Physician");
            this.Property(t => t.DX_CreatedON).HasColumnName("DX_CreatedON");
            this.Property(t => t.DX_CreatedBy).HasColumnName("DX_CreatedBy");
            this.Property(t => t.DX_Void).HasColumnName("DX_Void");
            this.Property(t => t.DX_Saved).HasColumnName("DX_Saved");
        }
    }
}
